<?php

use Illuminate\Http\Request;
//用户管理
Route::prefix('admin')->middleware('auth:sanctum')->group(function(){
    Route::post('create', 'Admin\RegisterController@create');
    Route::post('store', 'Admin\RegisterController@store');
    Route::post('edit', 'Admin\RegisterController@edit');
    Route::post('update', 'Admin\RegisterController@update');
    Route::post('delete', 'Admin\RegisterController@destory');
    Route::post('login', 'Admin\LoginController@login');
    Route::post('role', 'Admin\LoginController@role');
    Route::post('get_role', 'Admin\LoginController@getRole');
    Route::post('reset_password', 'Admin\RegisterController@resetPasswd');
    Route::post('reset_password_dz', 'Admin\RegisterController@resetPasswdDz');
});
Route::prefix('admin')->group(function(){
    Route::post('list', 'Admin\RegisterController@list');
    Route::post('updateopenid', 'Admin\RegisterController@updateopenid');
});
//部门管理
Route::prefix('department')->middleware('auth:sanctum')->group(function(){
    Route::post('store', 'DepartmentController@store');
    Route::post('edit', 'DepartmentController@edit');
    Route::post('update', 'DepartmentController@update');
    Route::post('delete', 'DepartmentController@destory');
});
//部门管理
Route::prefix('department')->group(function(){
    Route::post('list', 'DepartmentController@list');
});
//职务管理
Route::prefix('post')->middleware('auth:sanctum')->group(function(){
    Route::post('list','RoleController@list');
    Route::post('store','RoleController@store');
    Route::post('edit','RoleController@edit');
    Route::post('update','RoleController@update');
    Route::post('delete','RoleController@destory');
});
//财务管理
Route::prefix('v2/finance')->middleware('auth:sanctum')->group(function(){
    Route::post('list','FinacneController@list');
    Route::post('edit','FinacneController@edit');
});
//权限管理
Route::middleware('auth:sanctum')->prefix('permission')->group(function(){

    Route::post('module/list','Admin\ModuleController@list');
    Route::post('module/store','Admin\ModuleController@store');
    Route::post('module/edit','Admin\ModuleController@edit');
    Route::post('module/update','Admin\ModuleController@update');
    Route::post('module/delete','Admin\ModuleController@destory');


    Route::post('role/list','Admin\RoleController@list');
    Route::post('role/store','Admin\RoleController@store');
    Route::post('role/edit','Admin\RoleController@edit');
    Route::post('role/update','Admin\RoleController@update');
    Route::post('role/delete','Admin\RoleController@destory');

    Route::post('list','Admin\PermissionController@list');
    Route::post('create','Admin\PermissionController@create');
    Route::post('store','Admin\PermissionController@store');
    Route::post('edit','Admin\PermissionController@edit');
    Route::post('update','Admin\PermissionController@update');
    Route::post('destory','Admin\PermissionController@destory');

    //角色分配权限方法
    Route::post('role_has_permission','Admin\RoleHasPermissionController@roleHasPermission');
    Route::post('role_resolve_permission','Admin\RoleHasPermissionController@roleResolvePermission');
    Route::post('role_owner_permission','Admin\RoleHasPermissionController@roleOwnerPermission');
    Route::post('role_get_permission','Admin\RoleHasPermissionController@roleGetPermission');
    //直接获取用户权限
    Route::post('get_all_permission','Admin\RoleHasPermissionController@getUserAllPermission');
    Route::post('edit_user_permission','Admin\RoleHasPermissionController@editUserPermission');
    Route::post('update_user_permission','Admin\RoleHasPermissionController@updateUserPermissions');

});



